package com.fayou.cloud.controller;

import com.fayou.cloud.entites.Payment;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * (Payment)表控制层
 *
 * @author makejava
 * @since 2020-05-08 21:33:57
 */
@RestController
@RequestMapping("/consumer/payment")
public class OrderController {
    /**
     * 服务对象
     */
    @Resource
    private RestTemplate restTemplate;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("/selectOne")
    public Payment selectOne(@RequestParam Integer id) {
        return restTemplate.getForObject("http://CLOUD-PAYMENT-SERVICE" + "/payment/selectOne?id=" + id, Payment.class);
    }

}